package com.edu.scau.entity;



import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "commodity")
public class Commodity {
	@Id
	@Column(name = "commodity_id")
	private Integer id;
	@Column(name = "name")
	private String name;
	@Column(name = "price")
	private Double price;
	@Column(name = "image_url")
	private String imageUrl;
	@Column(name = "description")
	private String description;
	@Column(name = "average_number")
	private Integer averageNumber;
	@Column(name = "classification")
	private String classification;
	
	@OneToMany(targetEntity = Sold.class, mappedBy = "commodity")
	private Set<Sold> solds;
	
	@OneToMany(targetEntity = ShoppingCart.class, mappedBy = "commodity")
	private Set<ShoppingCart> shoppingCarts;
	
	
	public Commodity() {
		// TODO Auto-generated constructor stub
	}


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public Double getPrice() {
		return price;
	}


	public void setPrice(Double price) {
		this.price = price;
	}


	public String getImageUrl() {
		return imageUrl;
	}


	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}


	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public Integer getAverageNumber() {
		return averageNumber;
	}


	public void setAverageNumber(Integer averageNumber) {
		this.averageNumber = averageNumber;
	}


	public String getClassification() {
		return classification;
	}


	public void setClassification(String classification) {
		this.classification = classification;
	}


	public Set<Sold> getSolds() {
		return solds;
	}


	public void setSolds(Set<Sold> solds) {
		this.solds = solds;
	}


	public Set<ShoppingCart> getShoppingCarts() {
		return shoppingCarts;
	}


	public void setShoppingCarts(Set<ShoppingCart> shoppingCarts) {
		this.shoppingCarts = shoppingCarts;
	}
	
	

}
